package com.changgou.pay.mq.queue;


import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;

import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;


@Component
@RabbitListener(queues = "${mq.pay.queue.seckillpay}")
public class PayMessageListener {
    @RabbitHandler
    public void getMessage(String message) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
        System.out.println("监听消息的时间:" + simpleDateFormat.format(new Date()));
        System.out.println("监听到的消息:" + message);
    }
}
